package com.stein.mentalarithmetic;

import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;

public class Test23Add33 extends Testdouble_digit {

	public Test23Add33(Skin skin) {
		super(skin);
		quesion = "%d + %d = ? ";
	}
String re = "";
	@Override
	protected void nextTest() {

		x = MathUtils.random(10, 99);
		y =  MathUtils.random(10, 99);
		String question = String.format(quesion, new Object[]{x,y});
		questionLabel.setText(question);
		re =   "   "+x+"\n"
				+ "+ "+y+"\n"
				+ "--------";
		resultLabel.setText(re);
	}
	@Override
	protected void showResult() {
		//re+"\n()" 
		int t1 = y/10*10;
		int t2 = y%10;
		result_q = String.format(re+"\n(%d+%d+%d)\n=%d", new Object[]{x,t1,t2,(x+y)});
		resultLabel.setText(result_q);
	}
	@Override
	protected void setName() {
		this.name = Test23Add33.class.getSimpleName();
	}

}
